﻿@model SketchTour.Models.LoginModel
@using Resources
@{
    ViewBag.Title = "Index";
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <link href="~/Content/Site.css" rel="stylesheet" />
    <link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.20.min.js")" type="text/javascript"></script>
    <title>Login</title>
    <script language="javascript" type="text/javascript">
        //Function get value for dropdownlist when the language dropdownlist is changed
        $(function () {
            $('#Language').change(function () {
                try {
                    var strValue = $('#Language option:selected').val();
                    $.ajax({
                        url: 'MSUS00/CheckLanguage',
                        type: 'POST',
                        contentType: 'application/json;',
                        data: JSON.stringify({ _ValueLanguage: strValue }),
                        success: function (data) {

                            if (data.success) { //show that id is valid 
                                window.location.href = data.redirectUrl;
                            }
                            else { //show that id is not valid 
                                alert("False");
                            }
                        }
                    });
                } catch (e)
                { alert(e); }
            });
        });
    </script>
</head>
<body bgcolor="#EFF3FB" onload="updateClock(); setInterval('updateClock()', 1000 )">
    <div align="center">
    </div>
    <div id="divlogin">
    @using (Html.BeginForm("Index", "MSUS00"))
    {
        <table>
            <tbody>
                <tr>
                    <td colspan="2">
                        <p>
                            <b>@Resource.MSLG00_SCR_Title</b></p>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <span></span>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            <label class="requirement">
                                *</label>
                            <label for="UserName">
                                @Resource.MSLG00_SCR_lblUserName</label>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @*checking validation if username field is null*@
                            @Html.TextBoxFor(m => m.UserName)
                            @Html.ValidationMessageFor(m => m.UserName)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            <label class="requirement">
                                *</label>
                            <label for="Password">
                                @Resource.MSLG00_SCR_lblPassWord</label>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @*checking validation if password field is null*@
                            @Html.PasswordFor(m => m.Password)
                            @Html.ValidationMessageFor(m => m.Password)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            <label class="requirement">
                                *</label>
                            <label for="Password">
                                @Resource.MSLG00_SCR_lblLanguage</label>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.DropDownList("Language", (SelectList)ViewBag.ddpLanguage)
                        </div>
                    </td>
                </tr>
                <tr>
                </tr>
                <tr>
                    <td colspan="2">
                        <p>                        
                            @*<input type="submit" value="@Resource.MSUS00_SCR_btnLogin" />*@
                            <input type="button" value="@Resource.MSLG00_SCR_btnLogin" onclick="location.href='Home/Index'" />                        
                        </p>
                    </td>
                </tr>
                <tr>
                </tr>
                <tr>
                    <td colspan="2">
                        <label>
                            @Resource.MSLG00_SCR_lblWarning
                        </label>
                    </td>
                </tr>
            </tbody>
        </table>
    }
    </div>
</body>
</html>
